﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presenters.Users;


namespace University.Workshop.Presentation.Users
{
    /// <summary>
    /// Interaction logic for PageModifyView.xaml
    /// </summary>
    public partial class PageModifyView : Page, IModifyUserView
    {
        PresenterModifyUserView pModifyUserView;

        public PageModifyView(Model.User kardex)
        {
            pModifyUserView = new PresenterModifyUserView(this, kardex);
            InitializeComponent();
        }


        private void GoStepOne_Click(object sender, RoutedEventArgs e)
        {
            pModifyUserView.GoStepOne();
        }

        private void GoStepTwo_Click(object sender, RoutedEventArgs e)
        {
            pModifyUserView.GoStepTwo();
        }

        private void btnCancelModify_Click(object sender, RoutedEventArgs e)
        {
            ReturnSearchUser();
        }

        private void btnModifyKardex_Click(object sender, RoutedEventArgs e)
        {
            pModifyUserView.ModifyUser();
        }

        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            pModifyUserView.GoBackPage();
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            pModifyUserView.GoNextPage();
        }




        public void CallSecondPage()
        {
            PageSecondStepModifyUser pp = new PageSecondStepModifyUser(pModifyUserView);
            ModifyBasic = pp;
            frmContent.NavigationService.Navigate(pp);
            GoStepTwo.IsEnabled = true;
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            frmContent.Navigate(new PageFirstStepModifyUser(pModifyUserView));
            pModifyUserView.FirstTime();
        }


        public void CallFirstPage()
        {
            PageFirstStepModifyUser pp = new PageFirstStepModifyUser(pModifyUserView);
            ModifyBasic = pp;
            frmContent.NavigationService.Navigate(pp);
        }


        public IModifyBasicView ModifyBasic
        {
            get;
            set;
        }

        public void SystemMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Atencion!!!", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public void ErrorMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Error!!!", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public void ReturnSearchUser()
        {
            this.NavigationService.Navigate(new SearchUser());
        }
    }
}
